let a = 1
console.log(a + 1)
function specifiedFunction(b) {
  console.log(this.first)
  console.log(this.last)
  
  return b
} 

function readonly(target, name, descriptor) {
  // descriptor对象原来的值如下
  // {
  //   value: specifiedFunction,
  //   enumerable: false,
  //   configurable: true,
  //   writable: true
  // };
  descriptor.writable = false;
  return descriptor;
}

class Person {
  constructor(first,last){
    this.first = first
    this.last = last
  }
  name(b) {
    return `${this.first} ${this.last}`
  }
}
let descriptor = {
  value: specifiedFunction,
  enumerable: false,
  configurable: true,
  writable: true
};

descriptor = readonly(Person.prototype, 'name', descriptor) || descriptor;
Object.defineProperty(Person.prototype, 'name', descriptor);
let erson = new Person('hello ','word')
console.log(erson.name('hello word!'))